package summer.codegenerator.persistence.hibernate.base.tool;

import java.io.Serializable;

/**
 * 
 * 
 * @author 蒋振
 * @since 2019年7月3日 上午8:56:00
 */
public class Pagination implements Serializable {

	private static final long serialVersionUID = 1L;

	private Integer pageNo;

	private Integer pageSize;

	private Long total;

	public Integer getPageNo() {
		return pageNo;
	}

	public void setPageNo(Integer pageNo) {
		this.pageNo = pageNo;
	}

	public Integer getPageSize() {
		return pageSize;
	}

	public void setPageSize(Integer pageSize) {
		this.pageSize = pageSize;
	}

	/**
	 * @return the total
	 */
	public Long getTotal() {
		return total;
	}

	/**
	 * @param total the total to set
	 */
	public void setTotal(Long total) {
		this.total = total;
	}

	public Integer first() {
		return (pageNo - 1) * pageSize;
	}

	public Integer max() {
		return pageSize;
	}
}
